package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.Series;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SeriesMapper {

    /**
     * 插入系列数据
     * @param series
     */
    @AutoFill(value = OperationType.INSERT)
    void insert(Series series);

    /**
     * 根据书籍分类的id查询系列的数量setmeal==series,dish==book,
     * @param id
     * @return
     */
    @Select("select count(id) from series where category_id = #{categoryId}")
    Integer countByCategoryId(Long id);
}
